# Makefile for beyondffplayer

CROSS	=
CC	= gcc
CFLAGS	= -Wall -O -g

TARGET	= coloroftpd
SOURCES	= $(wildcard *.c)
OBJECTS	= $(SOURCES:%.c=%.o)

SUBDIRS	= libavcodec/ libavformat/ libavutil/
LIBDIRS	= -Llibavcodec/ -Llibavformat/ -Llibavutil/
LIBS	= 

all: $(TARGET)
	$(CROSS)$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(LIBDIRS) $(LIBS)
	@echo BUILD DONE!

$(TARGET): $(OBJECTS)
	for dir in $(SUBDIRS); do make -C $$dir all || exit 1; done

$(OBJECTS): %.o: %.c
	$(CROSS)$(CC) $(CFLAGS) -c $< -o $@

clean:
	for dir in $(SUBDIRS); do make -C $$dir clean || exit 1; done
	-rm -f $(OBJECTS) $(OUT)

.PHONY:	all clean
